<!--
 * @Descripttion: 
 * @version: @ 1.0.0
 * @Author: 朱江洲
 * @Date: 2022-04-07 08:44:53
 * @LastEditors: 朱江洲
 * @LastEditTime: 2022-04-08 10:01:07
-->
<template>
  <div class="app-container">
    <div class="header">
      <div class="bread">
        <p>自定义字段</p>
      </div>
    </div>
    <el-table :data="tableData" :height="tableHight">
      <el-table-column label="模块" prop="name"> </el-table-column>
      <el-table-column label="更新时间" prop="updateTime"> </el-table-column>
      <el-table-column label="操作">
        <template slot-scope="scope">
          <span @click="edit(scope.row)">编辑</span>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
import { moduleList } from "../../../api/custom.js";
export default {
  data() {
    return {
      tableHight: window.innerHeight - 270,
      tableData: [{ moudle: "线索", updateTime: "2022-4-14" }],
    };
  },
  mounted() {
    window.onresize = () => {
      return (() => {
        this.tableHight = window.innerHeight - 270;
      })();
    };
  },
  activated() {
    this.tableHight = window.innerHeight - 270;
  },
  created() {
    this.getList();
  },
  methods: {
    getList() {
      moduleList().then((res) => {
        console.log(res);
        this.tableData = res.data;
      });
    },
    edit(row) {
      this.$router.push(`/detailCustom?id=${row.id}`);
    },
  },
};
</script>

<style lang="less" scoped>
.header {
  width: 100%;
  height: 74px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #ececec;
  .bread {
    display: flex;
    align-items: center;
    margin-left: 5px;
    padding: 0 10px;
    height: 30px;
    display: flex;
    vertical-align: middle;
    height: 74px;
    border-bottom: 2px solid #1267fa;
    p {
      text-align: center;
      //   margin-left: 10px;
      font-size: 16px;
      font-family: PingFangSC-Medium, PingFang SC;
      font-weight: 500;
      //   color: #2b2b2b;
    }
  }
}
.cell {
  span {
    color: #1267fa;
    cursor: pointer;
  }
}
</style>